package com.share.controller;

import com.share.domain.User;
import com.share.feign.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * created by caifan 2018/06/06
 */
@RestController
public class OrderController {
    @Autowired
    UserFeignClient userFeignClient;

    @RequestMapping(value = "/rest/user/{id}", method = RequestMethod.GET)
    public User findById(@PathVariable("id")Long id) {
        return userFeignClient.getUserById(id);
    }
}
